﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master"
    CodeBehind="Default.aspx.vb" Inherits="myproject.List" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h1>Ratings on Each Application</h1> <br />
     <p><asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource4">
            <series>
                <asp:Series Name="Series1"  XValueMember="Picture_fkid" YValueMembers="TotalRating">
                </asp:Series>
            </series>
            <chartareas>
                <asp:ChartArea Name="ChartArea1">
                </asp:ChartArea>
            </chartareas>
        </asp:Chart>

          <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT  Sum(Rating) as TotalRating , Picture_fkid  FROM Comments group by Picture_fkid ">

             
          </asp:SqlDataSource>
      
        </p>
   <table>
        <tr>
            <td style="width=90%">
             <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
        DataSourceID="SqlDataSource1" CssClass="gv" AllowSorting="True">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="SL NO" SortExpression="ID" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" DataTextField="AppsName" HeaderText="Apps Name"
                DataNavigateUrlFormatString="Details.aspx?ID={0}" Text="Detail" />
            <asp:BoundField DataField="Descripton" HeaderText="Descripton" SortExpression="Descripton" />
            <asp:ImageField DataImageUrlField="Picture" HeaderText="Picture">
                <ControlStyle Height="150px" Width="150px" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
            </td>
            <td style="vertical-align: top">
             <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
        DataSourceID="SqlDataSource2">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="TagName" DataNavigateUrlFormatString="showByTag.aspx?tag={0}"
                DataTextField="TagName" HeaderText="Tag" />
        </Columns>
    </asp:GridView>
            </td>
        </tr>
    </table>
   
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT * FROM [Tags]">
    </asp:SqlDataSource>
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT * FROM [Photo Sharing AppsList]">
    </asp:SqlDataSource>
   
</asp:Content>
